"""django_test URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.conf.urls import url
from django.urls import re_path
from . import views as view
from . import testdb as tdb
from . import search as search
from . import auth_test as at
from . import f_cBV as fcbv



from django.urls import path,include # 从 django.urls 引入 include

urlpatterns = [
    path("fbc_cbv/", fcbv.Login.as_view()),
    # path('sv/',"/sessionvalue.html"),
    path("delsession/", at.delsessionfun),
    path("getsession/", at.getsessionfun),
    path("setsession/", at.setsessionfun),
    path("delcookie/", at.delcookiefun),
    path("getcookie/", at.getcookiefun),
    path("setcookie/", at.setcookiefun),
    path("logout/", at.logout),
    path("userlogin/", at.userlogin),
    path("createUser2/", at.createUser2),
    path("createUser/", at.createUser),
    path("login/", view.login ,name='login'),
    path("login0/", view.login0 ,name='login0'),
    path("app01/", include("app01.urls")),
    path("app02/", include("app02.urls")),
    re_path(r'^articles/([0-9]{4})/$', view.rest), # 正则路径
    re_path("^articles/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$", view.rest3),
    path("rest2/<int:year>/<int:month>/", view.rest2),#非正则
    url(r'^search-form/$', search.search_form),
    url(r'^search/$', search.search),
    url(r'^search-post/$', search.search_post),
    path('testdb2/', tdb.testdb2),
    path('testdel/', tdb.testdel),
    path('testupdate/', tdb.testupdate),
    path('testdb/', tdb.testdb),
    path('admin/', admin.site.urls),
    path('ch01/',view.ch01),
    path('ch02/',view.ch02),
    path('ch03/',view.ch03),
    url(r'^$', view.hello),
]
